public class HingedDoor {
  public int numSwings( int initialAngle, int reduction ){
  
    double init = (double) initialAngle;
    int times = 0;
    
    if ( init < 5 )
      return 0;
    
    while( init > 5 ) {
      times++;
      init = init/reduction;
    }
    return times;
  }
}